"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var core_1 = require("@angular/core");
var api_1 = require("../../../../config/api");
var PermissionService = /** @class */ (function () {
    function PermissionService(httpService) {
        this.httpService = httpService;
    }
    /**
     * 权限列表
     * @param name
     * @param model
     * @param orderField
     * @param orderSort
     * @param pageSize
     * @returns {Observable<R>}
     */
    PermissionService.prototype.getPermissionList = function (name, model, orderField, orderSort, page, pageSize) {
        var url = api_1.adSystemApiUrl + "/v1/admin/permissions/list?name=" + name + "&model=" + model + "&orderField=" + orderField + "&orderSort=" + orderSort + "&page=" + page + "&pageSize=" + pageSize;
        return this.httpService.httpGetAuth(url).map(function (data) { return data; });
    };
    /**
     * 权限详情
     * @param id
     * @returns {Observable<R>}
     */
    PermissionService.prototype.getPermissionInfo = function (id) {
        var url = api_1.adSystemApiUrl + "/v1/admin/permissions/" + id + "/info";
        return this.httpService.httpGetAuth(url).map(function (data) { return data; });
    };
    /**
     * 权限添加
     * @param data
     * @returns {Observable<R>}
     */
    PermissionService.prototype.addPermission = function (data) {
        var url = api_1.adSystemApiUrl + "/v1/admin/permissions/add";
        return this.httpService.httpPostAuth(url, data).map(function (data) { return data; });
    };
    /**
     * 权限修改
     * @param data
     * @returns {Observable<R>}
     */
    PermissionService.prototype.editPermission = function (data) {
        var url = api_1.adSystemApiUrl + "/v1/admin/permissions/edit";
        return this.httpService.httpPostAuth(url, data).map(function (data) { return data; });
    };
    /**
     * 权限删除
     * @param id
     * @returns {Observable<R>}
     */
    PermissionService.prototype.delPermission = function (id) {
        var url = api_1.adSystemApiUrl + "/v1/admin/permissions/" + id + "/del";
        return this.httpService.httpPostAuth(url, null).map(function (data) { return data; });
    };
    PermissionService = __decorate([
        core_1.Injectable()
    ], PermissionService);
    return PermissionService;
}());
exports.PermissionService = PermissionService;
